package com.sisSaude.utils;

import java.io.ByteArrayOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.HeaderFooter;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;

public class GenericPdfWriter {

    // protected vars
	protected Paragraph 				paragraph 		= null;
	protected PdfPTable 				table 			= null;
	protected Document					document		= null;
	protected ByteArrayOutputStream		pdfStream		= null;
	protected HeaderFooter 				pageHeader 		= null;
	protected HeaderFooter 				pageFooter		= null;

	// constructor
	public GenericPdfWriter() {
	}
	
	// protected methods
	protected void initDocument(Rectangle pageSize, float marginLeft, float marginRight, float marginTop, float marginBottom) throws Exception {
		document 	= new Document(pageSize, marginLeft, marginRight, marginTop, marginBottom);
		pdfStream 	= new ByteArrayOutputStream();
		PdfWriter.getInstance(document, pdfStream);
	}
}
